<style>
    #level-update {
        padding: 20px 25px 25px 0;
    }

    .layui-form-label {
        width: 140px;
    }

    .layui-input-block {
        margin-left: 170px;
    }

    .layui-layer-page .layui-layer-content {
        overflow: visible !important;
    }
</style>
<div class="layui-fluid" id="level-update">
    <form class="layui-form" action="" lay-filter="level-update-form">
        <div class="layui-form-item website-hide">
            <label class="layui-form-label website-form-item-require">id：</label>
            <div class="layui-input-block">
                <input type="text" name="declareId" data-th-value="${declare.declareId}">
                <input type="text" name="topicPlanId" data-th-value="${declare.topicPlanId}">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <label class="layui-form-label">课题名称：</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" th:value="${declare.name}" readonly
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">级别：</label>
                    <div class="layui-input-block">
                        <select name="finalLevelTypeCode" lay-verify="required">
                            <option value="">请选择</option>
                            <option
                                    th:selected="${ declare.finalLevelTypeCode eq item.code}"
                                    th:each="item : ${levelType}"
                                    th:value="${item.code}" th:text="${item.name}">
                            </option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item website-hide">
            <button class="layui-btn" lay-submit="" lay-filter="level-update-form-submit" id="submit"></button>
            <button type="reset" class="layui-btn" id="reset"></button>
        </div>
    </form>
</div>

<script data-th-inline="javascript">
    layui.use(['website', 'form', 'validate'], function () {
        var $ = layui.$,
            website = layui.website,
            layer = layui.layer,
            form = layui.form,
            declare = [[${declare}]],
            validate = layui.validate;
        form.verify(validate);
        form.render();
        initFormValue();

        function initFormValue() {
            form.val("level-update-form", {
                "declareId": declare.declareId,
                "name": declare.name
            });
        }

        form.on('submit(level-update-form-submit)', function (data) {
            website.post(ctx + 'biz/evaluation/entrust/defineLevel', data.field, function () {
                layer.closeAll();
                website.alert.success('定级成功');
                $('#website-evaluation').find('#query').click();
            });
            return false;
        });
    });
</script>